package com.gitee.form_token.common;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

@Component
@PropertySource("classpath:application.yml")
public class ValueUtil implements InitializingBean {

    @Value("${cytp.jwt.secret}")
    private String jwt_secret;

    @Value("${cytp.jwt.expire}")
    private long jwt_expire;

    @Value("${cytp.redis.expire}")
    private long redis_Expire;

    @Value("${cytp.mq.expire}")
    private long mq_Expire;

    public static String jwtSecret;
    public static long jwtExpire;
    public static long redisExpire;
    public static long mqExpire;

    @Override
    public void afterPropertiesSet() throws Exception {

        jwtSecret = jwt_secret;
        jwtExpire = jwt_expire;
        redisExpire = redis_Expire;
        mqExpire = mq_Expire;

    }
}
